using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ServiceModel;
using EIA.WCFService.ClientProxy;

namespace EIA.Basic.BLL.ClientProxy
{
    /// <summary>
    /// generated by binking
    /// </summary>
    public class XDictProxy : ProxyBase
    {
        
        public IClientChannel ListType(System.Int32 type, Action<System.Collections.Generic.IList<EIA.Basic.Model.DicType>> callback, Action<Exception> errorCallback = null)
        {
            object[] args = new object[] { Newtonsoft.Json.JsonConvert.SerializeObject(type) };
            string json_args = Newtonsoft.Json.JsonConvert.SerializeObject(args);

            return string.IsNullOrEmpty(X.ServiceAddress) ?
                CallFuncByAddToken2Headder("EIA.Basic.BLL.XDictBlp", "ListType", json_args, callback, errorCallback) :
                CallFuncByAddToken2Headder(X.ServiceAddress, "EIA.Basic.BLL.XDictBlp", "ListType", json_args, callback, errorCallback);
        }
        public IClientChannel Insert(EIA.Basic.Model.DicItem item, Action<System.Int32> callback, Action<Exception> errorCallback = null)
        {
            object[] args = new object[] { Newtonsoft.Json.JsonConvert.SerializeObject(item) };
            string json_args = Newtonsoft.Json.JsonConvert.SerializeObject(args);

            return string.IsNullOrEmpty(X.ServiceAddress) ?
                CallFuncByAddToken2Headder("EIA.Basic.BLL.XDictBlp", "Insert", json_args, callback, errorCallback) :
                CallFuncByAddToken2Headder(X.ServiceAddress, "EIA.Basic.BLL.XDictBlp", "Insert", json_args, callback, errorCallback);
        }
        public IClientChannel Update(EIA.Basic.Model.DicItem item, Action<System.Boolean> callback, Action<Exception> errorCallback = null)
        {
            object[] args = new object[] { Newtonsoft.Json.JsonConvert.SerializeObject(item) };
            string json_args = Newtonsoft.Json.JsonConvert.SerializeObject(args);

            return string.IsNullOrEmpty(X.ServiceAddress) ?
                CallFuncByAddToken2Headder("EIA.Basic.BLL.XDictBlp", "Update", json_args, callback, errorCallback) :
                CallFuncByAddToken2Headder(X.ServiceAddress, "EIA.Basic.BLL.XDictBlp", "Update", json_args, callback, errorCallback);
        }
        public IClientChannel Delete(EIA.Basic.Model.DicItem item, Action<System.Boolean> callback, Action<Exception> errorCallback = null)
        {
            object[] args = new object[] { Newtonsoft.Json.JsonConvert.SerializeObject(item) };
            string json_args = Newtonsoft.Json.JsonConvert.SerializeObject(args);

            return string.IsNullOrEmpty(X.ServiceAddress) ?
                CallFuncByAddToken2Headder("EIA.Basic.BLL.XDictBlp", "Delete", json_args, callback, errorCallback) :
                CallFuncByAddToken2Headder(X.ServiceAddress, "EIA.Basic.BLL.XDictBlp", "Delete", json_args, callback, errorCallback);
        }
        public IClientChannel Count(System.String type_id, Action<System.Int32> callback, Action<Exception> errorCallback = null)
        {
            object[] args = new object[] { Newtonsoft.Json.JsonConvert.SerializeObject(type_id) };
            string json_args = Newtonsoft.Json.JsonConvert.SerializeObject(args);

            return string.IsNullOrEmpty(X.ServiceAddress) ?
                CallFuncByAddToken2Headder("EIA.Basic.BLL.XDictBlp", "Count", json_args, callback, errorCallback) :
                CallFuncByAddToken2Headder(X.ServiceAddress, "EIA.Basic.BLL.XDictBlp", "Count", json_args, callback, errorCallback);
        }
        public IClientChannel List(System.String type_id,System.Int32 pagesize,System.Int32 page, Action<System.Collections.Generic.IList<EIA.Basic.Model.DicItem>> callback, Action<Exception> errorCallback = null)
        {
            object[] args = new object[] { Newtonsoft.Json.JsonConvert.SerializeObject(type_id), Newtonsoft.Json.JsonConvert.SerializeObject(pagesize), Newtonsoft.Json.JsonConvert.SerializeObject(page) };
            string json_args = Newtonsoft.Json.JsonConvert.SerializeObject(args);

            return string.IsNullOrEmpty(X.ServiceAddress) ?
                CallFuncByAddToken2Headder("EIA.Basic.BLL.XDictBlp", "List", json_args, callback, errorCallback) :
                CallFuncByAddToken2Headder(X.ServiceAddress, "EIA.Basic.BLL.XDictBlp", "List", json_args, callback, errorCallback);
        }
    }
}